﻿using System;
using System.Collections.Generic;
using System.Configuration;
using System.Linq;
using System.Web;

namespace ezCloud.Api.Common
{
    public class InternalServices
    {
        public static bool isAllowed()
        {
            if (IsInWhiteList( HttpContext.Current.Request.UserHostAddress))
            {
                return true;
            }
            return false;
        }
        static bool IsInWhiteList(string IP)
        {
            string listIP = ConfigurationManager.AppSettings["ChannelManagerWhiteListIP"];

            if (listIP != null)
            {
                if (listIP.IndexOf(IP) >= 0)
                {
                    return true;
                }
            }
            return false;
        }
        public static bool IsInWhiteListHotels(string hotelId)
        {
            string listHotles = ConfigurationManager.AppSettings["smsdemo"];

            if (listHotles != null)
            {
                if (listHotles.IndexOf(hotelId) >= 0)
                {
                    return true;
                }
            }
            return false;
        }
    }
}